<template>
    <div class="pages">
      <el-pagination
      @size-change="sizeChange"
      @current-change="change"
      :current-page.sync="page"
      :page-sizes="[5, 10, 20, 50]"
      :page-size="10"
      layout="prev, pager, next"
      :total="counts">
    </el-pagination>
    </div>
</template>

<script>
export default {
  name: 'Pages',
  data () {
    return {
      page: 1
    }
  },
  props: {
    counts: Number,
    current: Number
  },
  created () {},
  computed: {
    model () {
      return this.$store.state.model
    }
  },
  watch: {
    page () {
      this.update()
    }
  },
  methods: {
    sizeChange () {},
    change (i) {
      this.page = i
    },
    update () {
      this.$store.dispatch('pageChange', this.page)
    }
  }
}
</script>
